// +----------------------------------------------------------------------
// | 新车寻车api请求
// +----------------------------------------------------------------------

import request from "@/utils/request.js";

/**
 * 寻车列表
 */
export function newsCarsSearchReleaseList(sreach = '', source_type_id = '', registration_province = '', series_id = '', page = 1, page_num = 15) {
	return request.get(`search/newsCarsSearchReleaseList?sreach=${sreach}&page_num=${page_num}&page=${page}&source_type_id=${source_type_id}&registration_province=${registration_province}&series_id=${series_id}`);
}


/**
 * 我的寻车列表
 * @param String page 当前页数
 * @param String page_num 每页条数
 * @param String users_id 用户id
 */
export function newsCarsSearchMyReleaseList(page = 1, page_num = 15, users_id = '') {
	return request.get(`search/newsCarsSearchMyReleaseList?page=${page}&page_num=${page_num}&users_id=${users_id}`);
}

/**
 * 品牌列表
 */
export function carsBrandList() {
	return request.get('search/carsBrandList');
}

/**
 * 车系列表
 * @param {String}  brand_id 品牌id
 */
export function carsVehicleSeriesList(brand_id) {
	return request.get(`search/carsVehicleSeriesList?brand_id=${brand_id}`);
}

/**
 * 车型列表
 * @param {String}  series_id 车系id
 */
export function carsVehicleModelsList(series_id) {
	return request.get(`search/carsVehicleModelsList?series_id=${series_id}`);
}

/**
 * 外观内饰
 * @param {String}  model_id 二级车型id
 * @param {String}  state 颜色类型1：外观 2：内饰
 */
export function usedSearchColour(model_id, state) {
	return request.get(`cars/usedSearchColour?model_id=${model_id}&state=${state}`);
}

/**
 * 通用车辆颜色
 * @param {String}  car_color_state 数据类型 1：外观 2：内饰
 */
export function vehicleColor(car_color_state) {
	return request.get(`cars/vehicleColor?car_color_state=${car_color_state}`);
}

/**
 * 寻车发布
 */
export function newsCarsSearchReleaseAdd(data) {
	return request.post('search/newsCarsSearchReleaseAdd', data);
}

/**
 * 寻车详情
 * @param {String}  id 寻车主键id
 * @param {String}  users_id 用户id
 */
export function newsCarsSearchReleaseDetails(id, users_id) {
	return request.get(`search/newsCarsSearchReleaseDetails?id=${id}&users_id=${users_id}`);
}

/**
 * 搜索模块
 * 品牌
 * @param {String}  
 */
export function newsCarsSearchBrand() {
	return request.get(`search/newsCarsSearchBrand`);
}

/**
 * 搜索模块
 * 车系
 * @param {String}  brand_id 品牌id
 */
export function newsCarsSearchSeries(brand_id) {
	return request.get(`search/newsCarsSearchSeries?brand_id=${brand_id}`);
}

/**
 * 搜索模块
 * 车源类型
 * @param {String}  
 */
export function newsCarsSearchCarSourceType() {
	return request.get(`search/newsCarsSearchCarSourceType`);
}

/**
 * 搜索模块
 * 省
 * @param {String}  
 */
export function newsCarsSearchProvince() {
	return request.get(`search/newsCarsSearchProvince`);
}

/**
 * 车系是否拥有
 * @param {String}  id 寻车主键id
 * @param {String}  users_id 用户id
 */
export function newsCarsSearchModelsHave(id, users_id) {
	return request.get(`search/newsCarsSearchModelsHave?id=${id}&users_id=${users_id}`,{},{},false);
}

/**
 * 寻车取消报价
 */
export function newsCarSearchQuotationCancel(data) {
	return request.post('search/newsCarSearchQuotationCancel', data);
}

/**
 * 拨打电话记录
 */
export function callHistory(data) {
	return request.post('common/callHistory', data);
}

/**
 * 寻车备注
 * @param {String}  state 1：新车 2：二手车
 */
export function usedSearchNotes(state) {
	return request.get(`cars/usedSearchNotes?state=${state}`);
}

/**
 * 寻车投诉标签
 * @param {String}  state 1：新车 2：二手车
 */
export function usedSearchComplaint(state) {
	return request.get(`cars/usedSearchComplaint?state=${state}`);
}

/**
 * 新车二手车举报寻车
 */
export function usedReportCarSearch(data) {
	return request.post('cars/usedReportCarSearch', data);
}
/**
 * 车源车型详情

 * @param {Object} usersId
 * @param {Object} carsId
 * @param {Object} city
 */
export function getCarDetail(usersId, carsId, city) {
	return request.get(`news/carsVehicleSourceDetails?cars_id=${carsId}&users_id=${usersId}&city=${city}`);
}

/**
 * 自提距离
 * @param {String}  state 1：新车 2：二手车
 */
export function usedSearchDistance(state) {
	return request.get(`cars/usedSearchDistance?state=${state}`);
}

/**
 * 店保情况
 * @param {String}  state 1：新车 2：二手车
 */
export function usedSearchSituation(state) {
	return request.get(`cars/usedSearchSituation?state=${state}`);
}

/**
 * 寻车报价添加
 */
export function newsCarsSearchQuotationAdd(data) {
	return request.post('search/newsCarsSearchQuotationAdd', data);
}

/**
 * 寻车报价修改
 */
export function newsCarsSearchQuotationUpdate(data) {
	return request.post('search/newsCarsSearchQuotationUpdate', data);
}

/**
 * 报价
 * @param {String}  quotation 报价类型 1：优惠点数 2：优惠万元 3：加价万元 4：直接报价
 * @param {String}  quotation_price 价格幅度
 * @param {String}  model_two_id 二级车型id
 */
export function quotation(quotation, quotation_price, model_two_id) {
	return request.get(`search/quotation?quotation=${quotation}&quotation_price=${quotation_price}&model_two_id=${model_two_id}`);
}

/**
 * 报价
 * @param {String}  users_id 用户id
 * @param {String}  id 寻车主键id
 */
export function newsCarsSearchMyReleaseDetails(users_id, id) {
	return request.get(`search/newsCarsSearchMyReleaseDetails?users_id=${users_id}&id=${id}`);
}

/**
 * 供应商报价列表
 * @param {String}  id 寻车主键id
 */
export function newsCarsSearchSupplierQuotationList(id) {
	return request.get(`search/newsCarsSearchSupplierQuotationList?id=${id}`);
}

/**
 * 报价
 * @param {String}  users_id 用户id
 * @param {String}  brand_id 品牌id
 * @param {String}  series_two_id 二级车系id
 */
export function newsCarsSearchQuotationList(page = 1, page_num = 15, users_id, brand_id, series_two_id) {
	return request.get(`search/newsCarsSearchQuotationList?page=${page}&page_num=${page_num}&users_id=${users_id}&brand_id=${brand_id}&series_two_id=${series_two_id}`);
}

/**
 * 关注/取消关注 店铺
 */
export function followStoreUpdate(data) {
	return request.post('news/followStoreUpdate', data);
}

/**
 * 报价反馈标签
 * @param {String}  1：新车 2：二手车
 */
export function usedSearchSearchFeedback(state) {
	return request.get(`cars/usedSearchSearchFeedback?state=${state}`);
}

/**
 * 新车二手车供应商反馈
 */
export function usedCarSearchQuotationFeedbackAdd(data) {
	return request.post('cars/usedCarSearchQuotationFeedbackAdd', data);
}

/**
 * 取消寻车
 */
export function newsCarsSearchMyReleaseCancel(data) {
	return request.post('search/newsCarsSearchMyReleaseCancel', data);
}

/**
 * 删除寻车
 */
export function newsCarsSearchMyReleaseDelete(data) {
	return request.post('search/newsCarsSearchMyReleaseDelete', data);
}

/**
 * 取消寻车标签
 * @param {String}  1：新车 2：二手车
 */
export function usedSearchQuotation(state) {
	return request.get(`cars/usedSearchQuotation?state=${state}`);
}

/**
 * 我的报价列表详情
 * @param {String}  users_id 	用户id
 * @param {String}  id 寻车主键id
 */
export function newsCarsSearchQuotationListDetails(users_id, id) {
	return request.get(`search/newsCarsSearchQuotationListDetails?users_id=${users_id}&id=${id}`);
}

/**
 * 我的报价列表详情
 * @param {String} id  报价主键id
 */
export function newsCarsSearchQuotationDetails(id) {
	return request.get(`search/newsCarsSearchQuotationDetails?id=${id}`);
}
/**
 * 改装车 二级车系
 */
export function getCarSeriesData() {
	return request.get(`news/hotRodCarsVehicleSeries`);
}
/**
 * 获取改装车列表
 * @param {Object} seriesId
 * @param {Object} search
 */
export function getVehicleData(seriesId,search,pageNum,page) {
	return request.get(`news/hotRodCarsList?series_id=${seriesId}&search=${search}&page_num=${pageNum}&page=${page}`);
}

/**
 * 我的报价列表详情
 * @param {String} users_id  用户id
 */
export function brandCarsSeriesSearch(users_id) {
	return request.get(`search/brandCarsSeriesSearch?users_id=${users_id}`);
}

/**
 * 我的报价列表详情
 * @param {String} source_type_id  车源类型idid
 */
export function newsCarsRemarksList(source_type_id) {
	return request.get(`release/newsCarsRemarksList?source_type_id=${source_type_id}`);
}

